fix a few latent issues in the thread patch
authorTom Tromey <tromey@redhat.com>
Thu, 6 Jun 2013 19:18:05 +0000 (13:18 -0600)
committerTom Tromey <tromey@redhat.com>
Thu, 6 Jun 2013 19:18:05 +0000 (13:18 -0600)
commit313dfb6277b3e1ef28c7bb76e776f10168e3f0a3
treed1028baf9549ea7342410ae76a41cdb67008f2b4
parentac70709c2ad3fa97e7553adfb4958c0a08faa40b
fix a few latent issues in the thread patch

* we called unbind_for_thread_switch unconditionally, but this
  is wrong if the previous thread exited
* likewise, exiting a thread should clear current_thread
* redundant assignment in run_thread
* clean up init_threads - no need to re-init the primary thread

This patch still sometimes causes weird hangs in "make check".
However, I think that is a kernel bug, since Emacs enters the zombie
state but its parent process hangs in wait.  This shouldn't happen.
src/thread.c